﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient; 
using System.Data;
using Stone.Library.DB;
using Stone.DataContracts; 

namespace CourseArraging.DAO
{
    class ZapDAO
    {
        #region  成员方法

		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public ZapEntity zap(string zap_sb_no)
        {
            ZapEntity zap = new ZapEntity();
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select zap_id,zap_sb_id,zap_sb_no,zap_sb_name,zap_mon_am1,zap_mon_am2,zap_mon_pm1,zap_mon_pm2,zap_mon_eve1,zap_mon_eve2,zap_tue_am1,zap_tue_am2,zap_tue_pm1,zap_tue_pm2,zap_tue_eve1,zap_tue_eve2,zap_wed_am1,zap_wed_am2,zap_wed_pm1,zap_wed_pm2,zap_wed_eve1,zap_wed_eve2,zap_thu_am1,zap_thu_am2,zap_thu_pm1,zap_thu_pm2,zap_thu_eve1,zap_thu_eve2,zap_fri_am1,zap_fri_am2,zap_fri_pm1,zap_fri_pm2,zap_fri_eve1,zap_fri_eve2,zap_sat_am1,zap_sat_am2,zap_sat_pm1,zap_sat_pm2,zap_sat_eve1,zap_sat_eve2,zap_sun_am1,zap_sun_am2,zap_sun_pm1,zap_sun_pm2,zap_sun_eve1,zap_sun_eve2 ");
			strSql.Append(" FROM zap ");
            strSql.Append(" where zap_sb_no=@zap_sb_no ");
			SqlParameter[] parameters = {
					new SqlParameter("@zap_sb_no", SqlDbType.Int,4)};
			parameters[0].Value = zap_sb_no;

            DataTable dt = DBExecuteUtil.querySqlTable(strSql.ToString(), parameters);
			if(dt.Rows.Count>0)
			{
				if(dt.Rows[0]["zap_sb_id"].ToString()!="")
				{
                    zap.zap_sb_id = int.Parse(dt.Rows[0]["zap_sb_id"].ToString());
				}
                zap.zap_sb_no = dt.Rows[0]["zap_sb_no"].ToString();
                zap.zap_sb_name = dt.Rows[0]["zap_sb_name"].ToString();
                zap.zap_mon_am1 = dt.Rows[0]["zap_mon_am1"].ToString();
                zap.zap_mon_am2 = dt.Rows[0]["zap_mon_am2"].ToString();
                zap.zap_mon_pm1 = dt.Rows[0]["zap_mon_pm1"].ToString();
                zap.zap_mon_pm2 = dt.Rows[0]["zap_mon_pm2"].ToString();
                zap.zap_mon_eve1 = dt.Rows[0]["zap_mon_eve1"].ToString();
                zap.zap_mon_eve2 = dt.Rows[0]["zap_mon_eve2"].ToString();
                zap.zap_tue_am1 = dt.Rows[0]["zap_tue_am1"].ToString();
                zap.zap_tue_am2 = dt.Rows[0]["zap_tue_am2"].ToString();
                zap.zap_tue_pm1 = dt.Rows[0]["zap_tue_pm1"].ToString();
                zap.zap_tue_pm2 = dt.Rows[0]["zap_tue_pm2"].ToString();
                zap.zap_tue_eve1 = dt.Rows[0]["zap_tue_eve1"].ToString();
                zap.zap_tue_eve2 = dt.Rows[0]["zap_tue_eve2"].ToString();
                zap.zap_wed_am1 = dt.Rows[0]["zap_wed_am1"].ToString();
                zap.zap_wed_am2 = dt.Rows[0]["zap_wed_am2"].ToString();
                zap.zap_wed_pm1 = dt.Rows[0]["zap_wed_pm1"].ToString();
                zap.zap_wed_pm2 = dt.Rows[0]["zap_wed_pm2"].ToString();
				zap.zap_wed_eve1=dt.Rows[0]["zap_wed_eve1"].ToString();
				zap.zap_wed_eve2=dt.Rows[0]["zap_wed_eve2"].ToString();
				zap.zap_thu_am1=dt.Rows[0]["zap_thu_am1"].ToString();
				zap.zap_thu_am2=dt.Rows[0]["zap_thu_am2"].ToString();
				zap.zap_thu_pm1=dt.Rows[0]["zap_thu_pm1"].ToString();
				zap.zap_thu_pm2=dt.Rows[0]["zap_thu_pm2"].ToString();
				zap.zap_thu_eve1=dt.Rows[0]["zap_thu_eve1"].ToString();
				zap.zap_thu_eve2=dt.Rows[0]["zap_thu_eve2"].ToString();
				zap.zap_fri_am1=dt.Rows[0]["zap_fri_am1"].ToString();
				zap.zap_fri_am2=dt.Rows[0]["zap_fri_am2"].ToString();
				zap.zap_fri_pm1=dt.Rows[0]["zap_fri_pm1"].ToString();
				zap.zap_fri_pm2=dt.Rows[0]["zap_fri_pm2"].ToString();
				zap.zap_fri_eve1=dt.Rows[0]["zap_fri_eve1"].ToString();
				zap.zap_fri_eve2=dt.Rows[0]["zap_fri_eve2"].ToString();
				zap.zap_sat_am1=dt.Rows[0]["zap_sat_am1"].ToString();
				zap.zap_sat_am2=dt.Rows[0]["zap_sat_am2"].ToString();
				zap.zap_sat_pm1=dt.Rows[0]["zap_sat_pm1"].ToString();
				zap.zap_sat_pm2=dt.Rows[0]["zap_sat_pm2"].ToString();
				zap.zap_sat_eve1=dt.Rows[0]["zap_sat_eve1"].ToString();
				zap.zap_sat_eve2=dt.Rows[0]["zap_sat_eve2"].ToString();
				zap.zap_sun_am1=dt.Rows[0]["zap_sun_am1"].ToString();
				zap.zap_sun_am2=dt.Rows[0]["zap_sun_am2"].ToString();
				zap.zap_sun_pm1=dt.Rows[0]["zap_sun_pm1"].ToString();
				zap.zap_sun_pm2=dt.Rows[0]["zap_sun_pm2"].ToString();
				zap.zap_sun_eve1=dt.Rows[0]["zap_sun_eve1"].ToString();
				zap.zap_sun_eve2=dt.Rows[0]["zap_sun_eve2"].ToString();
			}
            return zap;
		}
		/// <summary>
		/// 增加一条数据
		/// </summary>
		public int Add(ZapEntity zap)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into zap(");
			strSql.Append("zap_sb_id,zap_sb_no,zap_sb_name,zap_mon_am1,zap_mon_am2,zap_mon_pm1,zap_mon_pm2,zap_mon_eve1,zap_mon_eve2,zap_tue_am1,zap_tue_am2,zap_tue_pm1,zap_tue_pm2,zap_tue_eve1,zap_tue_eve2,zap_wed_am1,zap_wed_am2,zap_wed_pm1,zap_wed_pm2,zap_wed_eve1,zap_wed_eve2,zap_thu_am1,zap_thu_am2,zap_thu_pm1,zap_thu_pm2,zap_thu_eve1,zap_thu_eve2,zap_fri_am1,zap_fri_am2,zap_fri_pm1,zap_fri_pm2,zap_fri_eve1,zap_fri_eve2,zap_sat_am1,zap_sat_am2,zap_sat_pm1,zap_sat_pm2,zap_sat_eve1,zap_sat_eve2,zap_sun_am1,zap_sun_am2,zap_sun_pm1,zap_sun_pm2,zap_sun_eve1,zap_sun_eve2)");
			strSql.Append(" values (");
			strSql.Append("@zap_sb_id,@zap_sb_no,@zap_sb_name,@zap_mon_am1,@zap_mon_am2,@zap_mon_pm1,@zap_mon_pm2,@zap_mon_eve1,@zap_mon_eve2,@zap_tue_am1,@zap_tue_am2,@zap_tue_pm1,@zap_tue_pm2,@zap_tue_eve1,@zap_tue_eve2,@zap_wed_am1,@zap_wed_am2,@zap_wed_pm1,@zap_wed_pm2,@zap_wed_eve1,@zap_wed_eve2,@zap_thu_am1,@zap_thu_am2,@zap_thu_pm1,@zap_thu_pm2,@zap_thu_eve1,@zap_thu_eve2,@zap_fri_am1,@zap_fri_am2,@zap_fri_pm1,@zap_fri_pm2,@zap_fri_eve1,@zap_fri_eve2,@zap_sat_am1,@zap_sat_am2,@zap_sat_pm1,@zap_sat_pm2,@zap_sat_eve1,@zap_sat_eve2,@zap_sun_am1,@zap_sun_am2,@zap_sun_pm1,@zap_sun_pm2,@zap_sun_eve1,@zap_sun_eve2)");
			strSql.Append(";select @@IDENTITY");
			SqlParameter[] parameters = {
					new SqlParameter("@zap_sb_id", SqlDbType.Int,4),
					new SqlParameter("@zap_sb_no", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sb_name", SqlDbType.VarChar,50),
					new SqlParameter("@zap_mon_am1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_mon_am2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_mon_pm1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_mon_pm2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_mon_eve1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_mon_eve2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_tue_am1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_tue_am2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_tue_pm1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_tue_pm2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_tue_eve1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_tue_eve2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_wed_am1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_wed_am2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_wed_pm1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_wed_pm2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_wed_eve1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_wed_eve2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_thu_am1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_thu_am2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_thu_pm1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_thu_pm2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_thu_eve1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_thu_eve2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_fri_am1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_fri_am2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_fri_pm1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_fri_pm2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_fri_eve1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_fri_eve2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sat_am1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sat_am2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sat_pm1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sat_pm2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sat_eve1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sat_eve2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sun_am1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sun_am2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sun_pm1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sun_pm2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sun_eve1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sun_eve2", SqlDbType.VarChar,50)};
            parameters[0].Value = zap.zap_sb_id;
			parameters[1].Value = zap.zap_sb_no;
			parameters[2].Value = zap.zap_sb_name;
            parameters[3].Value = zap.zap_mon_am1 ?? "";
            parameters[4].Value = zap.zap_mon_am2 ?? "";
            parameters[5].Value = zap.zap_mon_pm1 ?? "";
			parameters[6].Value = zap.zap_mon_pm2 ?? "";
			parameters[7].Value = zap.zap_mon_eve1 ?? "";
			parameters[8].Value = zap.zap_mon_eve2 ?? "";
			parameters[9].Value = zap.zap_tue_am1 ?? "";
			parameters[10].Value = zap.zap_tue_am2 ?? "";
			parameters[11].Value = zap.zap_tue_pm1 ?? "";
			parameters[12].Value = zap.zap_tue_pm2 ?? "";
			parameters[13].Value = zap.zap_tue_eve1 ?? "";
			parameters[14].Value = zap.zap_tue_eve2 ?? "";
			parameters[15].Value = zap.zap_wed_am1 ?? "";
			parameters[16].Value = zap.zap_wed_am2 ?? "";
			parameters[17].Value = zap.zap_wed_pm1 ?? "";
			parameters[18].Value = zap.zap_wed_pm2 ?? "";
			parameters[19].Value = zap.zap_wed_eve1 ?? "";
			parameters[20].Value = zap.zap_wed_eve2 ?? "";
			parameters[21].Value = zap.zap_thu_am1 ?? "";
			parameters[22].Value = zap.zap_thu_am2 ?? "";
			parameters[23].Value = zap.zap_thu_pm1 ?? "";
			parameters[24].Value = zap.zap_thu_pm2 ?? "";
			parameters[25].Value = zap.zap_thu_eve1 ?? "";
			parameters[26].Value = zap.zap_thu_eve2 ?? "";
			parameters[27].Value = zap.zap_fri_am1 ?? "";
			parameters[28].Value = zap.zap_fri_am2 ?? "";
			parameters[29].Value = zap.zap_fri_pm1 ?? "";
			parameters[30].Value = zap.zap_fri_pm2 ?? "";
			parameters[31].Value = zap.zap_fri_eve1 ?? "";
			parameters[32].Value = zap.zap_fri_eve2 ?? "";
			parameters[33].Value = zap.zap_sat_am1 ?? "";
			parameters[34].Value = zap.zap_sat_am2 ?? "";
			parameters[35].Value = zap.zap_sat_pm1 ?? "";
			parameters[36].Value = zap.zap_sat_pm2 ?? "";
			parameters[37].Value = zap.zap_sat_eve1 ?? "";
			parameters[38].Value = zap.zap_sat_eve2 ?? "";
			parameters[39].Value = zap.zap_sun_am1 ?? "";
			parameters[40].Value = zap.zap_sun_am2 ?? "";
			parameters[41].Value = zap.zap_sun_pm1 ?? "";
			parameters[42].Value = zap.zap_sun_pm2 ?? "";
			parameters[43].Value = zap.zap_sun_eve1 ?? "";
			parameters[44].Value = zap.zap_sun_eve2 ?? "";

            object obj = DBExecuteUtil.executeSqlWithPar(strSql.ToString(), parameters);
			if (obj == null)
			{
				return 1;
			}
			else
			{
				return Convert.ToInt32(obj);
			}
		}
		/// <summary>
		/// 更新一条数据
		/// </summary>
        public void Update(ZapEntity zap)
		{
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update zap set ");
            strSql.Append("zap_mon_am1=@zap_mon_am1,");
            strSql.Append("zap_mon_am2=@zap_mon_am2,");
            strSql.Append("zap_mon_pm1=@zap_mon_pm1,");
            strSql.Append("zap_mon_pm2=@zap_mon_pm2,");
            strSql.Append("zap_mon_eve1=@zap_mon_eve1,");
            strSql.Append("zap_mon_eve2=@zap_mon_eve2,");
            strSql.Append("zap_tue_am1=@zap_tue_am1,");
            strSql.Append("zap_tue_am2=@zap_tue_am2,");
            strSql.Append("zap_tue_pm1=@zap_tue_pm1,");
            strSql.Append("zap_tue_pm2=@zap_tue_pm2,");
            strSql.Append("zap_tue_eve1=@zap_tue_eve1,");
            strSql.Append("zap_tue_eve2=@zap_tue_eve2,");
            strSql.Append("zap_wed_am1=@zap_wed_am1,");
            strSql.Append("zap_wed_am2=@zap_wed_am2,");
            strSql.Append("zap_wed_pm1=@zap_wed_pm1,");
            strSql.Append("zap_wed_pm2=@zap_wed_pm2,");
            strSql.Append("zap_wed_eve1=@zap_wed_eve1,");
            strSql.Append("zap_wed_eve2=@zap_wed_eve2,");
            strSql.Append("zap_thu_am1=@zap_thu_am1,");
            strSql.Append("zap_thu_am2=@zap_thu_am2,");
            strSql.Append("zap_thu_pm1=@zap_thu_pm1,");
            strSql.Append("zap_thu_pm2=@zap_thu_pm2,");
            strSql.Append("zap_thu_eve1=@zap_thu_eve1,");
            strSql.Append("zap_thu_eve2=@zap_thu_eve2,");
            strSql.Append("zap_fri_am1=@zap_fri_am1,");
            strSql.Append("zap_fri_am2=@zap_fri_am2,");
            strSql.Append("zap_fri_pm1=@zap_fri_pm1,");
            strSql.Append("zap_fri_pm2=@zap_fri_pm2,");
            strSql.Append("zap_fri_eve1=@zap_fri_eve1,");
            strSql.Append("zap_fri_eve2=@zap_fri_eve2,");
            strSql.Append("zap_sat_am1=@zap_sat_am1,");
            strSql.Append("zap_sat_am2=@zap_sat_am2,");
            strSql.Append("zap_sat_pm1=@zap_sat_pm1,");
            strSql.Append("zap_sat_pm2=@zap_sat_pm2,");
            strSql.Append("zap_sat_eve1=@zap_sat_eve1,");
            strSql.Append("zap_sat_eve2=@zap_sat_eve2,");
            strSql.Append("zap_sun_am1=@zap_sun_am1,");
            strSql.Append("zap_sun_am2=@zap_sun_am2,");
            strSql.Append("zap_sun_pm1=@zap_sun_pm1,");
            strSql.Append("zap_sun_pm2=@zap_sun_pm2,");
            strSql.Append("zap_sun_eve1=@zap_sun_eve1,");
            strSql.Append("zap_sun_eve2=@zap_sun_eve2");
            strSql.Append(" where zap_sb_id=@zap_sb_id ");
            SqlParameter[] parameters = {
					new SqlParameter("@zap_sb_id", SqlDbType.Int,4),
					new SqlParameter("@zap_mon_am1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_mon_am2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_mon_pm1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_mon_pm2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_mon_eve1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_mon_eve2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_tue_am1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_tue_am2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_tue_pm1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_tue_pm2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_tue_eve1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_tue_eve2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_wed_am1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_wed_am2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_wed_pm1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_wed_pm2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_wed_eve1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_wed_eve2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_thu_am1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_thu_am2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_thu_pm1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_thu_pm2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_thu_eve1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_thu_eve2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_fri_am1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_fri_am2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_fri_pm1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_fri_pm2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_fri_eve1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_fri_eve2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sat_am1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sat_am2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sat_pm1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sat_pm2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sat_eve1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sat_eve2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sun_am1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sun_am2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sun_pm1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sun_pm2", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sun_eve1", SqlDbType.VarChar,50),
					new SqlParameter("@zap_sun_eve2", SqlDbType.VarChar,50)};
            parameters[0].Value = zap.zap_sb_id;
            parameters[1].Value = zap.zap_mon_am1;
            parameters[2].Value = zap.zap_mon_am2;
            parameters[3].Value = zap.zap_mon_pm1;
            parameters[4].Value = zap.zap_mon_pm2;
            parameters[5].Value = zap.zap_mon_eve1;
            parameters[6].Value = zap.zap_mon_eve2;
            parameters[7].Value = zap.zap_tue_am1;
            parameters[8].Value = zap.zap_tue_am2;
            parameters[9].Value = zap.zap_tue_pm1;
            parameters[10].Value = zap.zap_tue_pm2;
            parameters[11].Value = zap.zap_tue_eve1;
            parameters[12].Value = zap.zap_tue_eve2;
            parameters[13].Value = zap.zap_wed_am1;
            parameters[14].Value = zap.zap_wed_am2;
            parameters[15].Value = zap.zap_wed_pm1;
            parameters[16].Value = zap.zap_wed_pm2;
            parameters[17].Value = zap.zap_wed_eve1;
            parameters[18].Value = zap.zap_wed_eve2;
            parameters[19].Value = zap.zap_thu_am1;
            parameters[20].Value = zap.zap_thu_am2;
            parameters[21].Value = zap.zap_thu_pm1;
            parameters[22].Value = zap.zap_thu_pm2;
            parameters[23].Value = zap.zap_thu_eve1;
            parameters[24].Value = zap.zap_thu_eve2;
            parameters[25].Value = zap.zap_fri_am1;
            parameters[26].Value = zap.zap_fri_am2;
            parameters[27].Value = zap.zap_fri_pm1;
            parameters[28].Value = zap.zap_fri_pm2;
            parameters[29].Value = zap.zap_fri_eve1;
            parameters[30].Value = zap.zap_fri_eve2;
            parameters[31].Value = zap.zap_sat_am1;
            parameters[32].Value = zap.zap_sat_am2;
            parameters[33].Value = zap.zap_sat_pm1;
            parameters[34].Value = zap.zap_sat_pm2;
            parameters[35].Value = zap.zap_sat_eve1;
            parameters[36].Value = zap.zap_sat_eve2;
            parameters[37].Value = zap.zap_sun_am1;
            parameters[38].Value = zap.zap_sun_am2;
            parameters[39].Value = zap.zap_sun_pm1;
            parameters[40].Value = zap.zap_sun_pm2;
            parameters[41].Value = zap.zap_sun_eve1;
            parameters[42].Value = zap.zap_sun_eve2;

            DBExecuteUtil.executeSqlWithPar(strSql.ToString(), parameters);
		}
		/// <summary>
		/// 获得数据列表
		/// </summary>
		public DataTable GetList(string strWhere)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select * ");
			strSql.Append(" FROM zap ");
			if(strWhere.Trim()!="")
			{
				strSql.Append(" where "+strWhere);
			}
			return DBExecuteUtil.querySqlTable(strSql.ToString());
		}

		#endregion  成员方法
    }
}
